<?php
	require_once('simpletest/autorun.php');
	require_once('../PHP/PostContainer.php');
	require_once('../PHP/dummyParser.php');
	require_once('../PHP/reddit.php');
	require_once('../PHP/4chanParser.php');
	
	class TestSetting extends UnitTestCase {
		function testAddParser() {
			$container = new PostContainer();
			$dummy = new DummyParser();
			$container->addParser($dummy);
			$this->assertTrue($container->parsers[$dummy->name] == $dummy);
		}
		
		function testRemoveParser() {
			$container = new PostContainer();
			$dummy = new DummyParser();
			$container->addParser($dummy);
			$container->removeParser($dummy->name);
			$this->assertTrue(count($container->parsers) == 0);
		}
		
		function testAddParsersByArray() {
			$arr = ['RedditFunny_1', '4chan_0'];
			$container = new PostContainer();
			$container->addParsersByArray($arr);
			$this->assertTrue($container->parsers["RedditFunny"]->name == "RedditFunny");
			$this->assertTrue($container->parsers["4chan"]->name == "4chan");
			$this->assertTrue($container->parsers["RedditFunny"]->status);
			$this->assertTrue(!$container->parsers["4chan"]->status);
		}
		
		
	}
?>